home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEsculptTemplate.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.3 KB  |  115 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //    Alias|Wavefront Script File
  19. //
  20. //    Creation Date:    May 29, 1997
  21. //    Author:            ajp
  22. //
  23. //    Procedure Name:
  24. //    AEsculptTemplate
  25. //
  26. //    Description Name;
  27. //    Creates the attribute editor controls for the sculpt node
  28. //
  29. //    Input Value:
  30. //    nodeName
  31. //
  32. //    Output Value:
  33. //    None
  34. //
  35.  
  36. global proc checkSculptMode ( string $node )
  37.  {
  38.      string $nodeAttr = $node + ".mode";
  39.      int $value = `getAttr $nodeAttr`;
  40.  
  41.      if ( $value == 2 /* stretch mode */ ) {
  42.          string $conns[];
  43.          $conns = `listConnections -d false ($node+".startPosition")`;
  44.  
  45.          if (0 == size($conns)) {
  46.             
  47.              // call the sculpt edit command so that a locator can
  48.              // get added if necessary
  49.              //
  50.              string $cmd = "sculpt -e -mode stretch "+ $node;
  51.              evalDeferred $cmd;
  52.          }
  53.      }
  54.  }
  55.  
  56. global proc checkInsideMode ( string $node )
  57.  {
  58.      string $nodeAttr = $node + ".insideMode";
  59.      int $value = `getAttr $nodeAttr`;
  60.  
  61.      if ( $value == 1 /* even mode */ ) {
  62.          string $conns[];
  63.          $conns = `listConnections -d false ($node+".startPosition")`;
  64.  
  65.          if (0 == size($conns)) {
  66.             
  67.              // call the sculpt edit command so that a locator can
  68.              // get added if necessary
  69.              //
  70.              string $cmd = "sculpt -e -insideMode even "+ $node;
  71.              evalDeferred $cmd;
  72.          }
  73.      }
  74.  }
  75.  
  76. global proc AEmaximumDisplacementNew( string $attrName )
  77. {
  78.     setUITemplate -pst attributeEditorTemplate;    
  79.      attrFieldSliderGrp -attribute $attrName -l "Max Displacement"
  80.             maxDisplacementSlider;
  81.     setUITemplate -ppt;
  82. }
  83.  
  84. global proc AEmaximumDisplacementReplace( string $attrName )
  85. {
  86.      attrFieldSliderGrp -e -attribute $attrName -l "Max Displacement"
  87.             maxDisplacementSlider;
  88. }
  89.  
  90. global proc AEsculptTemplate( string $nodeName )
  91. {
  92.     
  93.     editorTemplate -beginScrollLayout;
  94.     
  95.     editorTemplate -beginLayout "Sculpt History" -collapse false;
  96.         editorTemplate -addControl "mode" "checkSculptMode";
  97.         editorTemplate -addControl "insideMode" "checkInsideMode";
  98.         editorTemplate -callCustom "AEmaximumDisplacementNew"
  99.             "AEmaximumDisplacementReplace" "maximumDisplacement";
  100.         editorTemplate -addControl "dropoffType";
  101.         editorTemplate -addControl "dropoffDistance";
  102.     editorTemplate -endLayout;
  103.  
  104.     // include/call base class/node attributes
  105.     AEgeometryFilterCommon $nodeName;
  106.     AEgeometryFilterInclude $nodeName;
  107.  
  108.     editorTemplate -addExtraControls;
  109.     editorTemplate -endScrollLayout;
  110.  
  111.     editorTemplate -suppress "startPosition";
  112.     editorTemplate -suppress "maximumDisplacement";
  113.     editorTemplate -suppress "extendedEnd";
  114. }
  115.